import getChineseName from "@utils/getChineseName";

export default function () {
  const table = document.querySelector('#bugzilla-body table') as HTMLTableElement;
  const tds = Array.from(document.querySelectorAll('#bugzilla-body table td')) as HTMLTableCellElement[];

  if (table) {
    // @ts-ignore
    table.style = "border-collapse: collapse";

    const persons = JSON.parse(localStorage.getItem('personsMap') ?? '{}');

    if (Array.isArray(tds)) {
      tds.forEach((td: HTMLTableCellElement) => {
        td.innerText = getChineseName(persons, td.innerText);
      });
    }
  }
}